<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <!-- 国内使用 -->
    <script type="text/javascript" charset="utf-8" src="//g.alicdn.com/sd/nch5/index.js?t=2015052012"></script>
    <!-- 若您的主要用户来源于海外，请替换使用下面的js资源 -->
    <!-- <script type="text/javascript" charset="utf-8" src="//aeis.alicdn.com/sd/nch5/index.js?t=2015052012"></script> -->
</head>
<body>
<div id="__nc" style="margin-left:auto;margin-right:auto;width:80%;height:100px;padding-top:100px;">
    <div id="nc"></div>
</div>

<script>
    var view = "{$view}";
    var appkey = "FFFF0N0000000000A7D4";
    var scene = "nc_other_h5";
    var nc_token = ["FFFF0N0000000000A7D4", (new Date()).getTime(), Math.random()].join(':');
    var nc = NoCaptcha.init({
        renderTo: '#nc',
        appkey: appkey,
        scene: scene,
        token: nc_token,
        trans: {"key1": "code200"},
        elementID: ["usernameID"],
        is_Opt: 0,
        language: "cn",
        timeout: 10000,
        retryTimes: 5,
        errorTimes: 5,
        inline: false,
        apimap: {
            // 'analyze': '//a.com/nocaptcha/analyze.jsonp',
            // 'uab_Url': '//aeu.alicdn.com/js/uac/909.js',
        },
        bannerHidden: false,
        initHidden: false,
        callback: function (data) {
            // window.console && console.log(nc_token)
            // window.console && console.log(data.csessionid)
            // window.console && console.log(data.sig)
            // console.log(data);
            var arr = {nc_token: nc_token, csessionid: data.csessionid, sig: data.sig, appkey: appkey, scene: scene};
            arr = JSON.stringify(arr);
            if (view == 'android') {
                console.log(11111);
                window.android.JavacallHtmlGoodClick(arr);
            } else if (view == 'ios') {
                window.webkit.messageHandlers.newUserActivity.postMessage(arr);
            } else {
                return false;
            }
        },
        error: function (s) {
        }
    });
    NoCaptcha.setEnabled(true);
    nc.reset();//请务必确保这里调用一次reset()方法

    NoCaptcha.upLang('cn', {
        'LOADING': "加载中...",//加载
        'SLIDER_LABEL': "请向右滑动验证",//等待滑动
        'CHECK_Y': "验证通过",//通过
        'ERROR_TITLE': "非常抱歉，这出错了...",//拦截
        'CHECK_N': "验证未通过", //准备唤醒二次验证
        'OVERLAY_INFORM': "经检测你当前操作环境存在风险，请输入验证码",//二次验证
        'TIPS_TITLE': "验证码错误，请重新输入"//验证码输错时的提示
    });
</script>
</body>
</html>